cmake_minimum_required(VERSION 4.0)
project(sdl_draw_tools)

set(CMAKE_CXX_STANDARD 20)

# /Users/dongguijun/vcpkg/scripts/buildsystems/vcpkg.cmake
#set(VCPKG_ROOT "/Users/dongguijun/vcpkg")
#set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")





find_package(SDL2 CONFIG REQUIRED)

find_package(SDL2_image CONFIG REQUIRED)

find_package(SDL2_ttf CONFIG REQUIRED)
find_package(SDL2_mixer CONFIG REQUIRED)


add_executable(sdl_draw_tools main.cpp
        Global.h
        Global.cpp
        Button.h
        Button.cpp
        ColorBar.cpp
        ColorBar.h
        Shape.cpp
        Shape.h
        SLine.cpp
        SLine.h
        SRect.cpp
        SRect.h
        SEllipse.cpp
        SEllipse.h
        STriangle.cpp
        STriangle.h
        ShapeBar.cpp
        ShapeBar.h
        SLayout.cpp
        SLayout.h
        SManager.cpp
        SManager.h)

if(WIN32)

    target_link_libraries(sdl_draw_tools
            $<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
            $<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
            $<IF:$<TARGET_EXISTS:SDL2_image::SDL2_image>,SDL2_image::SDL2_image,SDL2_image::SDL2_image-static>
            $<IF:$<TARGET_EXISTS:SDL2_ttf::SDL2_ttf>,SDL2_ttf::SDL2_ttf,SDL2_ttf::SDL2_ttf-static>
            $<IF:$<TARGET_EXISTS:SDL2_mixer::SDL2_mixer>,SDL2_mixer::SDL2_mixer,SDL2_mixer::SDL2_mixer-static>
            ws2_32
            mswsock
            ${Boost_LIBRARIES})
else ()
    target_link_libraries(sdl_draw_tools
            $<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
            $<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
            $<IF:$<TARGET_EXISTS:SDL2_image::SDL2_image>,SDL2_image::SDL2_image,SDL2_image::SDL2_image-static>
            $<IF:$<TARGET_EXISTS:SDL2_ttf::SDL2_ttf>,SDL2_ttf::SDL2_ttf,SDL2_ttf::SDL2_ttf-static>
            $<IF:$<TARGET_EXISTS:SDL2_mixer::SDL2_mixer>,SDL2_mixer::SDL2_mixer,SDL2_mixer::SDL2_mixer-static>
            ${Boost_LIBRARIES})
endif ()

